package com.glodon.paas.account.dao.mysql;

import org.springframework.beans.factory.annotation.Autowired;

import com.glodon.paas.account.dao.RoleDao;
import com.glodon.paas.account.dao.domain.RoleEntity;
import com.glodon.paas.account.dao.mapper.RoleEntityMapper;

public class RoleDaoMysqlImpl implements RoleDao {
	@Autowired
	private RoleEntityMapper roleEntityMapper;
	
	@Override
	public String insert(RoleEntity entity) {
		 roleEntityMapper.insertSelective(entity);
		return entity.getId();
	}

	@Override
	public RoleEntity get(String id) {
		return roleEntityMapper.selectByPrimaryKey(id);
	}

	@Override
	public int delete(String id) {
		return roleEntityMapper.deleteByPrimaryKey(id);
	}

}
